/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jpa.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Usuario
 */
@Entity
@Table(name = "contacto", catalog = "Sig", schema = "")
@NamedQueries({
    @NamedQuery(name = "Contacto.findAll", query = "SELECT c FROM Contacto c"),
    @NamedQuery(name = "Contacto.findByIdContacto", query = "SELECT c FROM Contacto c WHERE c.idContacto = :idContacto"),
    @NamedQuery(name = "Contacto.findByNombre", query = "SELECT c FROM Contacto c WHERE c.nombre = :nombre"),
    @NamedQuery(name = "Contacto.findByMsn", query = "SELECT c FROM Contacto c WHERE c.msn = :msn"),
    @NamedQuery(name = "Contacto.findByCorreo1", query = "SELECT c FROM Contacto c WHERE c.correo1 = :correo1"),
    @NamedQuery(name = "Contacto.findByCorreo2", query = "SELECT c FROM Contacto c WHERE c.correo2 = :correo2"),
    @NamedQuery(name = "Contacto.findByCorreo3", query = "SELECT c FROM Contacto c WHERE c.correo3 = :correo3"),
    @NamedQuery(name = "Contacto.findByTel1", query = "SELECT c FROM Contacto c WHERE c.tel1 = :tel1"),
    @NamedQuery(name = "Contacto.findByTel2", query = "SELECT c FROM Contacto c WHERE c.tel2 = :tel2"),
    @NamedQuery(name = "Contacto.findByTel3", query = "SELECT c FROM Contacto c WHERE c.tel3 = :tel3")})
public class Contacto implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idContacto", nullable = false)
    private Integer idContacto;
    @Basic(optional = false)
    @Column(name = "nombre", nullable = false, length = 45)
    private String nombre;
    @Column(name = "msn", length = 45)
    private String msn;
    @Column(name = "correo1", length = 45)
    private String correo1;
    @Column(name = "correo2", length = 45)
    private String correo2;
    @Column(name = "correo3", length = 45)
    private String correo3;
    @Column(name = "tel1")
    private Integer tel1;
    @Column(name = "tel2")
    private Integer tel2;
    @Column(name = "tel3")
    private Integer tel3;
    @JoinColumn(name = "idProv", referencedColumnName = "idProveedor", nullable = false)
    @ManyToOne(optional = false)
    private Proveedor proveedor;

    public Contacto() {
    }

    public Contacto(Integer idContacto) {
        this.idContacto = idContacto;
    }

    public Contacto(Integer idContacto, String nombre) {
        this.idContacto = idContacto;
        this.nombre = nombre;
    }

    public Integer getIdContacto() {
        return idContacto;
    }

    public void setIdContacto(Integer idContacto) {
        this.idContacto = idContacto;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getMsn() {
        return msn;
    }

    public void setMsn(String msn) {
        this.msn = msn;
    }

    public String getCorreo1() {
        return correo1;
    }

    public void setCorreo1(String correo1) {
        this.correo1 = correo1;
    }

    public String getCorreo2() {
        return correo2;
    }

    public void setCorreo2(String correo2) {
        this.correo2 = correo2;
    }

    public String getCorreo3() {
        return correo3;
    }

    public void setCorreo3(String correo3) {
        this.correo3 = correo3;
    }

    public Integer getTel1() {
        return tel1;
    }

    public void setTel1(Integer tel1) {
        this.tel1 = tel1;
    }

    public Integer getTel2() {
        return tel2;
    }

    public void setTel2(Integer tel2) {
        this.tel2 = tel2;
    }

    public Integer getTel3() {
        return tel3;
    }

    public void setTel3(Integer tel3) {
        this.tel3 = tel3;
    }

    public Proveedor getProveedor() {
        return proveedor;
    }

    public void setProveedor(Proveedor proveedor) {
        this.proveedor = proveedor;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idContacto != null ? idContacto.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Contacto)) {
            return false;
        }
        Contacto other = (Contacto) object;
        if ((this.idContacto == null && other.idContacto != null) || (this.idContacto != null && !this.idContacto.equals(other.idContacto))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Contacto[idContacto=" + idContacto + "]";
    }

}
